<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="val">
        <div v-for="item in List">
            {{item}}
        </div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                info:["苹果","香蕉","栗子","橘子","yy","y1","1"],
                val:""
            },
        //     data:{
        //     nameList:["Msea", "陶气", "陶宝", "猫猫", "撸猫", "机器猫", "二傻子"],
        //     val:""
        // },

            computed: {
                List(){
                    var arr=[];
                   this.info.forEach(item=>{
                       if(item.indexOf(this.val)!=-1){
                            arr.push(item)
                       }
                   });
                    return arr;
                }
            },

        })
    </script>
    
</body>
</html>